//
//  Constant.swift
//  BaseSwift
//
//  Created by ghwang on 2018/9/26.
//  Copyright © 2018年 ghwang. All rights reserved.
//

import UIKit

class Constant: NSObject {

    
    //------------------测试地址------------------

//    public static let BaseURL:String = "http://47.110.128.72:8081"
    

    //------------------正式地址------------------

    public static let BaseURL:String = "https://api.hqctv.com.cn"



    //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//
    
    //渠道码
    public static let CROPCODE = "cgb2cfxs"
    
    public static let RENTCAR_URL = "https://m.zuzuche.com/zijia/?partner_id=H02527062"
    public static let RENTCAR_FOREIGN_URL = "https://m-h02527062.zuzuche.com/"

    public static let PHONE = "15692175267"

    

    //获取验证码
    public static let SEND_CODE = Constant.BaseURL+"/travel/app/index/toSendCode.do"

    //绑定手机号
    public static let BIND_PHONE = Constant.BaseURL+"/travel/app/index/appToBindMobile.do"
    //登录
    public static let LOGIN = Constant.BaseURL+"/travel/app/index/toLoginByMobile.do"
    
    //首页推荐产品
    public static let HOME_RECOM_GOODS = Constant.BaseURL+"/travel/app/index/productTop.do"

    //首页分类
    public static let HOME_CATEGORY = Constant.BaseURL+"/travel/app/index/projectClasslist.do"

    //首页推荐微社区
    public static let HOME_TOPIC = Constant.BaseURL+"/travel/app/index/userPostingTop.do"
    
    //首页推荐线路
     public static let HOME_LINE = Constant.BaseURL+"/travel/app/index/routeInfoTop.do"
    
    //首页景点推荐
    public static let HOME_SCENIC = Constant.BaseURL+"/travel/app/index/scenicTop.do"
    
    //首页分类数据
     public static let HOME_CATEGORY_LIST = Constant.BaseURL+"/travel/app/index/pageProjectDistance.do"
    
    //首页项目详情
     public static let HOME_CATEGORY_DETAIL = Constant.BaseURL+"/travel/app/index/projectDetail.do"
    
    //玩家产品
    public static  let PLAY_PRODUCTS = Constant.BaseURL+"/travel/app/order/pdtPage.do"
    
    //玩家产品详情
    public static  let PLAY_DETAILS = Constant.BaseURL+"/travel/app/order/pdtDetail.do"
     
    //玩家产品类型
    public static  let PLAY_CLASSISY = Constant.BaseURL+"/travel/app/order/pdtClassPage.do"
    
    //微社区
    public static  let SOCIAL_LIST = Constant.BaseURL+"/travel/app/posting/userPostingPage.do"

    //微详情
    public static  let SOCIAL_DETAIIL = Constant.BaseURL+"/travel/app/posting/userPostingDetail.do"
    
    //发布帖子
    public static  let PUBLISH_SOCIAL = Constant.BaseURL+"/travel/app/posting/doAddUserPosting.do"
    
    //微社区评论
    public static  let SOCIAL_COMMENT = Constant.BaseURL+"/travel/app/posting/doAddUserPostingReply.do"

    //收藏
    public static  let COLLECT = Constant.BaseURL+"/travel/app/user/doOptMyCollection.do"


    //收藏列表
    public static  let COLLECT_LIST = Constant.BaseURL+"/travel/app/user/myCollectionPage.do"

    //订单列表
    public static  let ORDER_LIST = Constant.BaseURL+"/travel/app/user/orderPage.do"
    
    //订单详情
    public static  let ORDER_DETAIL = Constant.BaseURL+"/travel/app/user/orderDetail.do"
    
    //下单
    public static  let COMMIT_ORDER = Constant.BaseURL+"/travel/app/order/doAddOrder.do"
    
    //产品评论
    public static  let PRODUCT_COMMENT = Constant.BaseURL+"/travel/app/order/doAddPdtAppraises.do"
    
    //获取产品评论列表
    public static  let PRODUCT_COMMENT_LIST = Constant.BaseURL+"/travel/app/order/pdtAppraisesPage.do"
    
    //项目评论
    public static  let PROJECT_COMMENT = Constant.BaseURL+"/travel/app/index/doAddProjectAppraise.do"
    
    //获取项目评论列表
    public static  let PROJECT_COMMENT_LIST = Constant.BaseURL+"/travel/app/index/projectAppraisesPage.do"
    
    //获取产品日价
    public static  let PRODUCT_DAYPRICE_LIST = Constant.BaseURL+"/travel/app/order/pdtDailyPrice.do"
    
    //提交咨询
    public static  let COMMIT_ZIXUN = Constant.BaseURL+"/travel/app/order/doAddPdtQus.do"
    
    //咨询列表
    public static  let ZIXUN_LIST = Constant.BaseURL+"/travel/app/user/myProductQusPage.do"
    
    //我的帖子列表
    public static  let MYTOPIC_LIST = Constant.BaseURL+"/travel/app/user/myPostingPage.do"
    
    //我的帖子详情
    public static  let MYTOPIC_DETAIL = Constant.BaseURL+"/travel/app/user/myPostingPage.do"
    
    //退出登录
    public static  let LOGOUT = Constant.BaseURL+"/travel/app/index/cancelUserToken.do"
    
    //修改个人信息
    public static  let MODIFY_PERSON_INFO = Constant.BaseURL+"/travel/app/user/doOptMyInfomation.do"
    
    //删除我的帖子
    public static  let DEL_MYTOPIC = Constant.BaseURL+"/travel/app/user/doCancelMyPosting.do"
    
    //根据code获取用户信息
    public static  let INFOFORCODE = Constant.BaseURL+"/travel/app/index/appToWechatLogin.do"
    
    //绑定手机号
    public static  let BINDPHONE = Constant.BaseURL+"/travel/app/index/appToBindMobile.do"
    
    //支付
    public static  let PAYORDER = Constant.BaseURL+"/travel/app/order/doPayOrder.do"
    //更新token
    public static  let UPDATETOKEN = Constant.BaseURL+"/travel/app/index/refreshUserToken.do"
    //支付回调通知
    public static  let PAYNOTIFICATION = Constant.BaseURL+"/travel/app/order/orderNotify.do"
    //订单取消
    public static  let ORDER_CANCEL = Constant.BaseURL+"/travel/app/order/doCancelOrder.do"
    //订单评论
    public static  let ORDER_COMMENT = Constant.BaseURL+"/travel/app/order/doCommentOrder.do"
    //活动产品
    public static  let ACTIVITY_PRODUCTS = Constant.BaseURL+"/travel/app/index/activityPics.do"
    
    
    
    public static func getOrderStatus(status:String,pay:String) ->String{
        
        var s = status;
        // NEW("NEW", "新建订单"), FAILED("FAILED", "失效订单"), SUCCESS("SUCCESS", "成功订单"), FINISH("FINISH", "结束订单"), APPRAISED("APPRAISED", "已评价");REFUNDING("REFUNDING", "退款中");
        if "NEW" == status
        {
            s = "待付款"
        }
        else if "FAILED" == status
        {
            s = "已失效"
        }
        else if "SUCCESS" == status
        {
            s = "待出行"
        }
        else if "FINISH" == status
        {
            if "PAYED" == pay
            {
                s = "待评价"
            }
            else
            {
                s = "已取消"
            }
        }
        else if "APPRAISED" == status
        {
            s = "已完成"
        }
        else if "REFUNDING" == status
        {
            s = "退款中"
        }
        return s
        
    }
    
    public static func getPayStatus(status:String) -> String
    {
        var s = status
        // UNPAY("UNPAY", "未支付"), PAYED("PAYED", "已支付");
        if "UNPAY" == status
        {
            s = "未支付"
        }
        else if "PAYED" == status
        {
            s = "已支付"
        }
        return s
    }

    public static func getPayType(status:String) -> String
    {
        var s = "暂无";
        // WECHAT("WECHAT", "微信支付"), ALIPAY("ALIPAY", "支付宝支付");
        if "WECHAT" == status
        {
            s = "微信支付"
        }
        else if "ALIPAY" == status
        {
            s = "支付宝支付"
        }
        return s
    }
}

